import { getTradeOrderVOByCustId } from "../../../api/tradeOrderController";
Page({
  /**
   * 页面的初始数据
   */
  data: {
    list:[],
    isLastPage: '', 
    pageNo: 1,    
    pageSize: 10,

    id: '',
  },
  onLoad(options){
    let { id } = options
    this.setData({
      id: id,
    })
    this.getTradeOrderVOByCustId()
  },
  /**
   * 获取直接推荐人下的订单集合
   */
  async getTradeOrderVOByCustId(){
    let resolve = await getTradeOrderVOByCustId({
      custId: this.data.id,
    })
    this.setData({
      list: resolve.data
    })
  },
  /**
   * 滚动
   */
  bindscrolltolower(e){
    if (!this.data.isLastPage) {
      this.data.pageNo++
      this.setData({
        pageNo: this.data.pageNo
      })
    }
  },
})